package com.ruoyi.dynamic.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.dynamic.mapper.RoomCoverMapper;
import com.ruoyi.dynamic.model.pojo.entity.RoomCover;
import com.ruoyi.dynamic.service.IRoomCoverService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;

/**
 * <p>
 * 房间封面图 服务实现类
 * </p>
 *
 * @author ${author}
 * @since 2024-12-03
 */
@Service
public class RoomCoverServiceImpl extends ServiceImpl<RoomCoverMapper, RoomCover> implements IRoomCoverService {

    @Override
    public List<String> getRoomCoverByUser(Long userId) {
        return lambdaQuery().eq(RoomCover::getUserId, userId).list().stream().map(RoomCover::getImgUrl).collect(Collectors.toList());
    }
}
